#include <stdbool.h>

struct ListNode{
    int data;
    struct ListNode *next;
};

typedef struct {
    struct ListNode *head;
    struct ListNode *tail;
} MyLinkedList;

// Create a linked list.
MyLinkedList *myLinkedListNew();

void myLinkedListDestroy(MyLinkedList *myLinkedList);

void checkAddress(void *p);

// Return the size of the list.
int myLinkedListSize(MyLinkedList *myLinkedList);

bool myLinkedListIsEmpty(MyLinkedList *myLinkedList);

void myLinkedListPushFront(MyLinkedList *myLinkedList, int value);

void myLinkedListPrintDebug(MyLinkedList *myLinkedList);

int myLinkedListFront(MyLinkedList *myLinkedList);

int myLinkedListBack(MyLinkedList *myLinkedList);

void myLinkedListPopFront(MyLinkedList *myLinkedList);

void myLinkedListPushBack(MyLinkedList *myLinkedList, int data);

void myLinkedListPopBack(MyLinkedList *myLinkedList);

void myLinkedListInsert(MyLinkedList *myLinkedList, int index, int data);

int myLinkedListValueAt(MyLinkedList *myLinkedList, int index);

void myLinkedListErase(MyLinkedList *myLinkedList, int index);

int myLinkedListNFromEnd(MyLinkedList *myLinkedList, int n);

void myLinkedListReverse(MyLinkedList *myLinkedList);

void myLinkedListRemove(MyLinkedList *myLinkedList, int data);